
import { integraltype_listAll } from "@/api/integraltype";

class Count {

    async getClassList(){
        let classList = new Array();
        let { data } = await integraltype_listAll({company_id: localStorage.getItem("companyId")});
        if (data.status == 100) {
            classList = data.data.rows.map(item => {
                return { value: item.id, label: item.integraltype_name };
            });
        }
        return classList;
    }

    async getToolData(){
        const data = [
            {el: 'date-picker', label: '时间', model: 'searchDate', type: 'daterange'},
            {el: 'input', label: '备注', model: 'remark'},
            {el: 'input', label: '姓名', model: 'user_name'},
            {el: 'select', label: '积分类型', model: 'integraltype_id', options: await this.getClassList()}
        ]
        return data;
    }
} 

const count = new Count();
export default count;
